home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue42 / diagram / readme.txt < prev   
Encoding:
Text File  |  1999-01-13  |  1.2 KB  |  29 lines

  1. Update: Diagramming In Delphi, Part 2
  2.  
  3. Thanks to Roberto De Marini for pointing out a flaw in my code from the above article in Issue 41. He correctly states that, as it stands, the event handler's pointers are lost when retrieving diagrams from
  4. files. I made a blue, to use an Australian term. In the code for Issue 41 (the use case diagram), if you make the event handlers published, they get stored by the streaming code. So the declaration for
  5. TMainForm should look like this:
  6.  
  7. TMainDlg = class(TForm)
  8.   ...  // All the controls etc
  9. private
  10.   FNextAction : TjimNextAction;
  11.   FStartShape : TjimCustomShape;
  12.   FEndShape   : TjimCustomShape;
  13.   procedure SetNextAction(Value : TjimNextAction);
  14.   procedure ChooseButton(TheButton : TToolButton);
  15.   procedure ConnectShapes(StartShape,EndShape : TjimCustomShape; ArrowType : TjimArrowType);
  16. public
  17.   property NextAction : TjimNextAction read FNextAction write SetNextAction;
  18. published
  19.   // The OnClick event handler for all shapes on the diagram
  20.   procedure ShapeClick(Sender : TObject);
  21.   // The OnDblClick event handler for all captions on the diagram
  22.   procedure CaptionDblClick(Sender : TObject);
  23. end;
  24.  
  25. The enclosed file mainform.pas replaces the original included on Issue 41's disk.
  26.  
  27. Jim Cooper.
  28.  
  29.